import { request } from "@/utils/request";
import type { ResType, CategoryEJI, Category } from "@/types/category/category";
//获取一级菜单
export const getCategoryAPI = (id: string | string[]) => {
  return request<ResType<CategoryEJI>>({
    url: "/category",
    params: {
      id,
    },
  });
};
//获取二级菜单
export const getSubCategoryAPI = (id: string | string[]) => {
  return request<ResType<Category>>({
    url: "/category/sub/filter",
    params: {
      id,
    },
  });
};
//获取导航数据
export const getSubCategoryDataAPI = (data: any) => {
  return request({
    url: "/category/goods/temporary",
    method: "POST",
    data,
  });
};